Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: show alert before closing transaction flow #2187

Merged
merged 7 commits into from
Jun 28, 2023

Conversation

iamacook
Copy link
Member

What it solves

Resolves direct exit of new transaction flow

How this PR fixes it

A confirmation dialog is now shown when exiting or navigating away from the new transaction flow which needs to first be accepted.

How to test it

Create a transaction, attempt to close the flow/navigate away with back button and observe the new confirmation dialog.

Screenshots

image

alert

Checklist

  • I've tested the branch on mobile 📱
  • I've documented how it affects the analytics (if at all) 📊
  • I've written a unit/e2e test for it (if applicable) 🧑‍💻

@iamacook iamacook self-assigned this Jun 27, 2023
@github-actions
Copy link

github-actions bot commented Jun 27, 2023

Branch preview

✅ Deploy successful!

https://flow_exit_warning--walletweb.review-wallet-web.5afe.dev

@github-actions
Copy link

github-actions bot commented Jun 27, 2023

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

// Hooks & variables
const [showCloseTooltip, setShowCloseTooltip] = useState<boolean>(false)
const { onClose } = useContext(TxModalContext)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this used? It was supposed to be an internal callback that outside components should only assign, but not call. Only TxModalProvider should call it. It shouldn't even be exported (my mistake that it is).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the user submits the last sync signature or it is received via poll, it closes the modal.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this scenario you’re supposed to call setTxFlow(undefined).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I've updated it accordingly, as well as removing onClose from the context.

@iamacook iamacook merged commit 42bf8b3 into epic-tx-flow Jun 28, 2023
@iamacook iamacook deleted the flow-exit-warning branch June 28, 2023 08:03
@github-actions github-actions bot locked and limited conversation to collaborators Jun 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants